
#ifndef __SDK_STREAM__INCLUDE__
#define __SDK_STREAM__INCLUDE__

namespace nebula { namespace sdk {

class IIStream
{
public:
	virtual ~IIStream() {};

public:
	// Read content from stream. return particular bytes read from the stream
	// return -1 if there is an error
	virtual int Read(void* ptr, unsigned int size) = 0;
};

class IOStream
{
public:
	virtual ~IOStream() {};

public:
	// Write content to stream. return particular bytes write successfully
	// return -1 if there is an error
	virtual int Write(const void* ptr, unsigned int size) = 0;
};

class IStreamCollection
{
public:
	virtual ~IStreamCollection() {};

public:
	virtual const char* GetRootPath() = 0;

	virtual IIStream* OpenIStream(const char* name) = 0;
	virtual IOStream* OpenOStream(const char* name) = 0;
	virtual void      DeleteStream(const char* name)= 0;
};

}} // end of nebula::sdk

#endif //end of __SDK_STREAM__INCLUDE__

